<!DOCTYPE html>
<html>

<head>
  <title></title>
  <script src="../../lib/svg-compile/generator.js"></script>
</head>

<body>
  <script>
    var svg_ast = {
      "tag": "svg",
      "attr": {
        "width": 100,
        "height": 100,
        "viewBox": "0 0 100 100",
        "xmlns": "http://www.w3.org/2000/svg",
        "version": "1.1"
      },
      "body": [{
        "tag": "rect",
        "attr": {
          "x": 0,
          "y": 0,
          "width": 100,
          "height": 100,
          "fill": "rgb(0%, 0%, 0%)"
        }
      }]
    }
    var g = generator(svg_ast);
    console.log(g);
      /* 打印输出如下：
      <svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" version="1.1">
        <rect x="0" y="0" width="100" height="100" fill="rgb(0%, 0%, 0%)"></rect>
      </svg>
     */
  </script>
</body>

</html>